
stu_list = []
def make_student():
    name = input("name")
    age = input("age")
    stu_dict = ({"name":name, "age":age})
    return stu_dict

if __name__ == '__main__':
#     三个学生信息
    for i in range(3):
        stu = make_student()
        stu_list.append(stu)

def show_stu_info():
    print("----学生列表信息----")
    i = 1
    for data in stu_list :
        print(f"{i}\t\t{data.get("name")}\t\t{data.get("age")}")
        i += 1
    print("------------------")

show_stu_info()

def get_stu_info():
    return len(stu_list)


print(get_stu_info())

def search_stu():
    name = input("name")
    for stu in stu_list:
        if name == stu["name"]:
            print(f"姓名：{stu.get("name")}，年龄：{stu.get('age')}")
            # 结束函数的执行
            return
    else:
        print(f"不存在{name}的学生")

search_stu()